home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes reversed ƒ / Full scroll up.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.2 KB  |  42 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 3
  4. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  5. #define theWindowWidth (boundsRect.right-boundsRect.left)
  6.  
  7. pascal short FullScrollUp(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Take the full screen minus the top strip, move it into the whole screen
  10.    shifted up by BoxSize, then take the topmost source strip and put it
  11.    in the bottom strip of the dest. window. */
  12.    
  13. pascal short FullScrollUp(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  14. {
  15.     short            x;
  16.     Rect        theRect, dest;
  17.     short            BoxSize;
  18.     
  19.     BoxSize=theWindowHeight/25;
  20.     
  21.     dest = boundsRect;
  22.     dest.top=dest.bottom-BoxSize;                /* bottom strip for new data */
  23.     
  24.     SetRect(&theRect, boundsRect.left, boundsRect.top, boundsRect.right, boundsRect.top+BoxSize);
  25.     
  26.     for(x = theWindowHeight - BoxSize; x >= 0; x -= BoxSize)
  27.     {
  28.         StartTiming();
  29.         ScrollTheRect(&boundsRect, 0, -BoxSize, 0L);
  30.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  31.                 &theRect, &dest, 0, 0L);
  32.         theRect.bottom+=BoxSize;
  33.         theRect.top+=BoxSize;
  34.         TimeCorrection(CorrectTime);
  35.     }
  36.     
  37.     CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  38.         &boundsRect, &boundsRect, 0, 0L);
  39.     
  40.     return 0;
  41. }
  42.